   {include file=cart.header.html}
   	<script type="text/javascript">
   	function accSub(num1, num2) {
		var r1, r2, m;
		try {
			r1 = num1.toString().split('.')[1].length;
		} catch (e) {
			r1 = 0;
		}
		try {
			r2 = num2.toString().split(".")[1].length;
		} catch (e) {
			r2 = 0;
		}
		m = Math.pow(10, Math.max(r1, r2));
		n = (r1 >= r2) ? r1 : r2;
		return (Math.round(num1 * m - num2 * m) / m).toFixed(n);
	}
	$(function(){
		var _scar=function(){
			var a=$("ul.receive-t"),
			b=$('#skippop'),
			c=$('#skippop > .skip-x'),
			d=$('#banklist img'),
			e=$('#pay_type'),
			f=$('#banklist'),
			g=$('#payPal'),
			h=$('#linkbtn'),
			i=$('#shop-payh'),
			j=$('#banklistb');
			return {
				a:a,
				b:b,
				c:c,
				d:d,
				e:e,
				f:f,
				g:g,
				h:h,
				i:i,
				j:j
			};
		}();
		var timer=0;
		var pass='default';
		/*列表切换*/
		_scar.a.wlTabs("dd.receive-panes > div");
		_scar.a.children('li').bind('click',function(){
			var i=_scar.a.children('li').index(this);
			_scar.e.val(i+1);
			if(i==0){
				_scar.f.find('#CMB').attr('checked',true);
				_scar.d.css('border','1px solid #fff');
			}else if(i==1){
				_scar.g.find('input[name="pay_bank"]').eq(0).attr('checked',true);
			}
		});
		_scar.f.find('label').click(function(){
			$("#"+$(this).attr("for")).click(); 
			return false;
		});
		_scar.j.find('label').click(function(){
			$("#"+$(this).attr("for")).click(); 
			return false;
		});
		_scar.d.bind('click',function(){
			_scar.d.css('border','1px solid #fff');
			$(this).css('border','1px solid red');
		});
		/*关闭弹出层*/
		_scar.c.bind('click',function(){
			_scar.b.hide();
			wl.hwloverlay();
			// window.location.reload();
		});
		/*延时菜单*/
		_scar.h.bind('mouseover',function(){
			clearTimeout(timer);
			_scar.i.css('display','block');
		});
		_scar.i.bind('mouseover',function(){
			clearTimeout(timer);
			_scar.i.css('display','block');
		});
		_scar.h.bind('mouseout',function(){
			timer=setTimeout(function(){
				_scar.i.css('display','none');
			},300);
		});
		_scar.i.bind('mouseout',function(){
			timer=setTimeout(function(){
				_scar.i.css('display','none');
			},300);
		});
		/*万菱网支付平台*/
		if($('#self_btn').length>0){
			/*use*/
			$('#self_btn').bind('click',function(){
				var checked=$(this).attr('checked');
				var totalPrice=parseFloat($(this).attr('totalPrice')); 
				var self_price=parseFloat($('#self_price').html().replace(',',''));
				var remain_price=parseFloat(accSub(totalPrice,self_price));
				if(checked){
					$('#self_input').attr('disabled',false).focus();
					if(remain_price<=0){  //enough
						$('#self_submit').show();
						$('#to_online_pay').val(0);
						$('#self_shade').show();
						$('input[type="submit"]').attr('disabled',true).css('background-color','#999');
					}else{
						$('#self_submit').hide();
						$('#to_online_pay').val(1);
						$('#self_shade').hide();
						$('input[type="submit"]').attr('disabled',false).css('background-color','#e6445b');
						$('#remain_price_wrap').show();
						$('#remain_price').html(wl.number_format(remain_price,2));
					}
				}else{
					$('#self_input').val('').attr('disabled',true);
					$('#self_submit').hide();
					$('#to_online_pay').val(1);
					$('#self_shade').hide();
					$('input[type="submit"]').attr('disabled',false).css('background-color','#e6445b');
					$('#remain_price_wrap').hide();
				}
			});
   			/*submit*/
			$('#self_submit').bind('click',function(){
				$('#shop_pay').submit();
			});
			$('#self_input').bind('keydown',function(event){
				if(event.which=='13'){
					$('#shop_pay').submit();
				}
			});
			/*form submit*/
			$('#shop_pay').bind('submit',function(){
				var self_input=$('#self_input');
				var totalPrice=parseFloat($('#self_btn').attr('totalPrice')); 
				var self_price=parseFloat($('#self_price').html().replace(',',''));
				var remain_price=parseFloat(accSub(totalPrice,self_price));
				var tips_fn=function(content,time){
					if($('#self_tips').length<=0){
						self_input.after(content);
						setTimeout(function(){
							$('#self_tips').remove();
						},time*1000);
					}
				};
				//开启自有存款判断
				if(self_input.attr('disabled')){
					wl.showpop('skippop');
					return;
				}else{
					//如果使用自有存款，表单当前页提交
					$('#shop_pay').removeAttr('target');
				}
				//开启自有存款
				if(!self_input.attr('disabled') && pass == 'default'){
					var psw=$.trim(self_input.val());
					if(!psw){
						var content=$('<span id="self_tips" style="margin-left:10px;color:red;">密码不能为空</span>');
						tips_fn(content,5);
					}else{
						var reg = /^[0-9A-Za-z|_|\-|+|*|!|@|#|$|%|^|&|(|)|~]{6,20}$/;
						if(reg.test(psw)){
							$.post('index.php?app=cashier&act=ajaxcheckpaypwd&pay_passw='+psw,function(data){
								if(data=='true'){
									/*avoid Infinite loops*/
									pass='next';
									$('#shop_pay').submit();
								}else{
									var content=$('<span id="self_tips" style="margin-left:10px;color:red;">密码验证失败</span>');
									tips_fn(content,3);
								}
							},'json');
						}else{
							var content=$('<span id="self_tips" style="margin-left:10px;color:red;">密码需为6-21位字母数字_组合</span>');
							tips_fn(content,5);
						}
					}
					return false;
				}
			});
		}else{
			$('#shop_pay').bind('submit',function(){
				wl.showpop('skippop');
			});
		}

	});
	function close_pop(){
		$('#skippop > .skip-x').click();
	}
	</script>
	<!-- 内容 -->
	<div class="content-shop">
		<dl class="shop-pay-t">
			<dt>
				<h5>您正在使用万菱收银台付款：</h5>
			</dt>
			<dd class="f-cb">
				<div class="shop-payl">
					<!-- <p>2014韩非正品女装印花镶钻纯棉短袖女T恤衫厂家直销8804</p> -->
					<p>共合并了<i>{$order_num}</i>笔订单</p>
				</div>
				<div class="shop-paym">
					<a href="javascript:void(0)" class="linkbtn" id="linkbtn">订单详情<i class="icon-scroll"></i></a>
				</div>
				<div class="shop-payr">订单总额： <span>{$total|price}</span> <!--（若有改价，请 <a href="javascript:void(0)" class="linkbtn">刷新</a>） --></div>
				<div class="shop-payh" id="shop-payh">		
					<table>
						<tr>
							<th>订单号</th>
							<th>商家名称</th>
							<th>金额</th>
						</tr>
                            <!--{foreach from=$order_info item=order}-->
						<tr>
							<td>{$order.order_sn}</td>
							<td>{$order.seller_name|escape}</td>
							<td>{$order.order_amount}</td>
						</tr>
                           <!--{/foreach}-->
					</table> 
					<p>
						收货地址：{$consignee.region_name|escape}&nbsp;&nbsp;{$consignee.address|escape}，{$consignee.zipcode}（邮编）{$consignee.consignee|escape}（收）{$consignee.phone_mob} 
					</p>
				</div>
			</dd>
		</dl>
		<form action="index.php?app=cashier&act=goto_pay" method="post" name="shop_pay" class="shop-pay" id="shop_pay" target="_blank">
			<input type="hidden" value="{$order_ids}" name="order_id" />
            	<input type="hidden" name="to_online_pay" id="to_online_pay" value="1" />
            	<input type="hidden" name="pay_type" id="pay_type" value="1" />
              <!-- {if $user_money > 0}-->
			<div id="self_cash" class="self-cash">
				<div class="top">
					<input type="checkbox" name="self_btn" id="self_btn" totalPrice="{$total}" value="1" /><label for="self_btn">使用礼品卡支付</label>，可用余额：<span id="self_price">{$user_money}</span> 元
				</div>
				<div class="middle">
					输入支付密码：<input type="password" id="self_input" name="pay_passw" disabled />  <!-- {if $is_pay_password == 1}--> <a href="javascript:void(0);" id="self_submit">确认支付</a><!--{/if}-->
                    <!-- {if $is_pay_password == 1}--> 
                    <span class="pay_pw_extra"><a href="{$user_site_url}/index.php?app=account_security&act=authen_verify&mode=find_pay_password&from=buyer" target="_blank" class="linkbtn">忘记支付密码</a></span>
                   	<!-- {else} -->
                    <span class="pay_pw_extra">你还未设置支付密码，<a href="{$user_site_url}/index.php?app=account_security&act=authen_verify&mode=set_pay_password" target="_blank" class="linkbtn">点此设置</a></span>
                    <!--{/if}-->
				</div>
			</div>
             <!--{/if}-->
			<dl class="shop-pay-detail" id="shop_pay_detail">
				<dt>
					<ul class="receive-t f-cb">
						<li>
							<a class="current">网银支付（储蓄卡、信用卡）</a>
						</li>
						<li>
							<a class="">支付宝等支付平台</a>
						</li>
					</ul>
				</dt>
				<dd class="receive-panes">
					<div class="banklist" id="banklist">
						<ul class="f-cb">
							<li>
								<input type="radio" name="pay_bank" value="CMB" checked="checked" id="CMB" />
									&nbsp;
								<label for="CMB">
									<img src="{res file=images/member/CMB.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="ICBCB2C" id="ICBCB2C" />
									&nbsp;
								<label for="ICBCB2C">
									<img src="{res file=images/member/ICBCB2C.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="CCB" id="CCB" />
									&nbsp;
								<label for="CCB">
									<img src="{res file=images/member/CCB.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="ABC" id="ABC" />
									&nbsp;
								<label for="ABC">
									<img src="{res file=images/member/ABC.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="BOCB2C" id="BOCB2C" />
									&nbsp;
								<label for="BOCB2C">
									<img src="{res file=images/member/BOCB2C.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="SPDB" id="SPDB" />
									&nbsp;
								<label for="SPDB">
									<img src="{res file=images/member/SPDB.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="PSBC-DEBIT" id="PSBC_DEBIT" />
									&nbsp;
								<label for="PSBC_DEBIT">
									<img src="{res file=images/member/PSBC-DEBIT.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="CMBC" id="CMBC" />
									&nbsp;
								<label for="CMBC">
									<img src="{res file=images/member/CMBC.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="CIB" id="CIB" />
									&nbsp;
								<label for="CIB"><img src="{res file=images/member/CIB.gif}" align="absmiddle" /></label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="CITIC" id="CITIC" />
									&nbsp;
								<label for="CITIC">
									<img src="{res file=images/member/CITIC.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="CEB-DEBIT" id="CEB-DEBIT" />
									&nbsp;
								<label for="CEBBANK">
									<img src="{res file=images/member/CEBBANK.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="COMM" id="COMM" />
									&nbsp;
								<label for="COMM">
									<img src="{res file=images/member/COMM.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="SPABANK" id="SPABANK" />
									&nbsp;
								<label for="SPABANK">
									<img src="{res file=images/member/SPABANK.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="GDB" id="GDB" />
									&nbsp;
								<label for="GDB">
									<img src="{res file=images/member/GDB.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="SHBANK" id="SHBANK" />
									&nbsp;
								<label for="SHBANK">
									<img src="{res file=images/member/SHBANK.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="NBBANK" id="NBBANK" />
									&nbsp;
								<label for="NBBANK">
									<img src="{res file=images/member/NBBANK.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="HZCBB2C" id="HZCBB2C" />
									&nbsp;
								<label for="HZCBB2C">
									<img src="{res file=images/member/HZCBB2C.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="BJRCB" id="BJRCB" />
									&nbsp;
								<label for="BJRCB">
									<img src="{res file=images/member/BJRCB.gif}" align="absmiddle" />
								</label>
							</li>
							<li>
								<input type="radio" name="pay_bank" value="FDB" id="FDB" />
									&nbsp;
								<label for="FDB">
									<img src="{res file=images/member/FDB.gif}" align="absmiddle" />
								</label>
							</li>
						</ul>
						<div class="pt10 pl15">
							<input type="submit" value="确定支付方式" class="subbtnhsb" />
						</div>
					</div>
					<div class="payPal" id="payPal">
						<div class="banklist" id="banklistb">
							<ul class="f-cb">
								<li>
									<p>
										<input name="pay_bank" type="radio" value="alipay" id="alipay" />
										&nbsp;
										<label for="alipay"><img src="{res file=images/member/alipay.jpg}" align="absmiddle" /></label>
									</p>
									<p style="width:160px;padding:10px 0px 0px 30px;">支付宝旗下产品 网上购物，快捷支付，无需开通网银，有卡就能付，双重密码保护+72小时资金赔付</p>
								</li>
                                                                <li>
									<p>
										<input name="pay_bank" type="radio" value="wxpay" id="wxpay" />
										&nbsp;
										<label for="wxpay"><img src="{res file=images/member/wxpaylogo.jpg}" align="absmiddle" /></label>
									</p>
									<p style="width:160px;padding:10px 0px 0px 30px;">{$visitor.user_name}</p>
								</li>
								<li>
									<p>
										<input name="pay_bank" type="radio" value="tenpay" id="tenpay" />
										&nbsp;
										<label for="tenpay"><img src="{res file=images/member/tenpaylogo.jpg}" align="absmiddle" /></label>
									</p>
									<p style="width:160px;padding:10px 0px 0px 30px;">腾讯集团旗下中国领先的第三方支付平台，一直致力于为互联网用户和企业提供安全、便捷、专业的在线支付服务。</p>
								</li>
								<li>
									<p>
										<input name="pay_bank" type="radio" value="bestpay" id="bestpay" />
										&nbsp;
										<label for="bestpay"><img src="{res file=images/member/bestpaylogo.jpg}" align="absmiddle" /></label>
									</p>
									<p style="width:160px;padding:10px 0px 0px 30px;">翼支付产品是中国电信的移动支付产品，通过网站、短信、语音等方式进行远程或手机刷POS机方式进行现场支付。</p>
								</li>
							</ul>
						</div>
						<div class="pt10 pl15">
							<input type="submit" value="确定支付方式" class="subbtnhsb" />
						</div>
					</div>
				</dd>
				<dd class="self-shade" id="self_shade"></dd>
				<dd id="remain_price_wrap">剩余支付：<i id="remain_price" class="remain-price"></i> 元</dd>
			</dl>
		</form>
		<div class="shop-pay-faq">
			<h5>付款遇到问题：</h5>
			<p>1，选择万菱交易有何保障？</p>
			<p>
				答：在万菱平台购物时，货款并未直接付给卖家，而是付款到万菱，您收到货物签收无误后，再次确认收货时，订单款项才会结算给卖家，相当于货到付款哦。
			</p>
			<p>2，没有网银怎么办？</p>
			<p>
				答：如果您没有网银，您可以通过支付宝平台来付款。
			</p>
			<p>3，我有网上银行，不知道怎么操作？</p>
			<p>
				答：可能是由于银行的数据没有即时传输，请您不要担心，稍后刷新页面查看。如较长时间仍显示未付款，可联系万菱客服(4008-333-685)为您解决。
			</p>
		</div>
	</div>
	<!-- 跳转弹出层 -->
	<div class="skippop" id="skippop">
		<a href="javascript:void(0)" class="skip-x">关闭</a>
		<div class="skip-t">温馨提示</div>
		<div class="skip-b">
			<h6>请您在新打开的页面上进行支付，支付完成前请不要关闭本窗口。</h6>
			<p>
				若已成功支付：
				<br />
				您还可以 <a href="{$user_site_url}/index.php?app=buyer_order&type=allorder" class="linkbtn">查看消费记录</a><a href="{$js_site_url}" class="linkbtn">继续购物</a>
			</p>
			<p>
				支付遇到问题：
				<br />
				您可以重新 <a href="javascript:void(0)" class="linkbtn" onclick="close_pop()">选择支付方式</a> 或<a target="_blank" href="http://www.wljiashi.com/article/30.html" class="linkbtn">联系客服</a>
			</p>
		</div>
	</div>
	<!-- 页脚 --> 
{include file="footer.index.simple.html"}